<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>

<!DOCTYPE html>
<html>
<head>
	<title>遴选结果查询</title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
	<style type="text/css">
    .box-body{
    margin-top:-2px;
    }    	
    </style>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>遴选结果查询</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">交易</a></li>
            <li class="active"><a href="#">配送关系</a></li>
            <li class="active"><a href="#">遴选结果查询</a></li>
        </ol>
    </section>
    <section class="content">
       <form id="form" method="post" class="form-horizontal">
        <div class=" box box-success">
            <div class="box-body">
				<div class="input">
					<div class="textalign1" >企业名称：</div>
                    <div class="boxinput"> 
                        <input type="text" class="textinput" id="delCompName" placeholder="企业名称"/>     
                    </div>
                    <div class="textalign1" >企业编码：</div>
                    <div class="boxinput"> 
                       <input type="text" class="textinput" id="delCompCode" placeholder="企业编码"/>     
                    </div>
                    
                     <div class="textalign1" >状态：</div>
                    <div class="boxinput"> 
                       <select  class="textinput" id="status" >
                       		<option value="">请选择</option>
                       		<option value="1">未遴选</option>
                       		<option value="2">遴选通过</option>
                       		<option value="3">遴选不通过</option>
                       		<option value="0">其他</option>
                       </select>     
                    </div>
                </div>   
                <div class="input">
                	<div class="textalign1" >配送范围：</div>
                    <div class="boxinput"> 
                       <select class="textinput" id="delRange">
                       		<option value="">请选择</option>
                       		<option value="0">全部</option>
                       		<option value="1">县级及县以上医疗机构</option>
                       		<option value="2">基层医疗机构</option>
                       </select>     
                    </div>
                	<div class="textalign" >
						 <button type="button" class="btn btn-success btn-sm" onclick="search()" id="selectc">查&nbsp;询</button>
					 </div> 
                </div>             
           </div>
        </div>
        </form>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
    </section>
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    
    //绑定回车
    $('#delCompCode,#delCompName,#delRange,#status').bind('keydown', function(event) {
        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
            $('#selectc').click();
        }
    }); 
    
    $("#delCompName").focus();//加载页面光标在第一个查询框上
    
    function search(currentPage) {
        var delCompCode = $.trim( $("#delCompCode").val());
        var delCompName = $.trim( $("#delCompName").val());
        var delRange = $.trim($("#delRange").val());
        var status = $.trim($("#status").val());
        $("#gridlist").jqGrid('setGridParam',{  
            datatype:'json',
            postData:{"delCompCode":delCompCode, "delCompName":delCompName, "delRange":delRange, "status":status},
            page:currentPage||1
        }).trigger("reloadGrid"); //重新载入  
    }
    
    $(function () {
        $("#gridlist").jqGrid({
            url: "getSelectResultList.html",
            mtype: "post",
            datatype: "json",
            autowidth: true,
            // height: 270,
            colNames: [
                '企业编码', 
                '企业名称',
                '状态',
                '配送范围',
                '遴选时间'
            ],
            colModel: [
                { name: 'delCompCode', width: 15, align:"center", sortable: false},
                { name: 'delCompName', width: 20, align:"center", sortable: false,
                	formatter:function(cellvalue, options, row) {
                            return compInfoLink(row.delCompCode, cellvalue, 1);
                        }		
                },
                { name: 'status', width: 10, align:"center", sortable: false},
                { name: 'delRange', width: 15, align:"center", sortable: false},
                { name: 'selDatetime', width: 15, hidden:true,align:"center", sortable: false},
            ], 
            rowNum: 20,
            rowList: [10, 20, 50, 100],
            rownumbers: true,
            pager: "#gridpage",
            caption: "配送企业列表",
            viewrecords: true,
            gridComplete:function(){
                //序号列宽度自适应（参数为jqgridID）http://localhost:8080/medstgmini/wsjDelRelation/toSelectResultSee.html
                autoRNWidth("gridlist");
                //数据只有一条时默认选中（参数为jqgridID）
                selectByOneData("gridlist");
            }
        });
        
        $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
        
        $(window).trigger("resize");
        $("#gridlist").jqGrid("setGridHeight",create());
    });
    
    
    </script>
</body>
</html>